home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5WPR004.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
4KB
|
109 lines
When you load Word for Windows, the program assumes you keep
your data files in your program directory. Unless you tell
it otherwise, that's where it will save new files. I can't
tell you how many times I've searched for a "missing" file,
only to find it lurking in my WinWord directory.
Fortunately, Word for Windows has a very powerful built-in
macro language that let me build a solution to the problem.
I wrote an AutoExec macro that runs when you first load
Word, prompting you to pick a data directory. You're not
even limited to eight-character labels for your directories,
but can use descriptive names like Jones Account or Personal
Letters.
If you want to change directories again during a session,
simply rerun AutoExec as you would any other macro (from the
macro dialog box or with an assigned shortcut key). Remember
to modify the case statements in the listing to reflect your
directories and subject headings.
David Walske
Beverly Hills, California
Editor's Note: Windows 3.1 allows you to specify a separate
start-up directory, letting you pick a default other than
WINWORD, but you'll still find this macro useful, because it
lets you choose between data directories on the fly.
The macro is included as the file WWDIR.TXT in the P5WPR
directory of your PowerBase *.* diskette, but because Word
for Windows doesn't let you import text directly into its
macro editor, getting the text into a macro is tricky.
Here's the best way: first, start Word for Windows and use
the Insert·File... command to import the text of the macro
into a new Word for Windows document. Then copy the body of
the macro to the clipboard, omitting the Sub Main statement
at the top and the End Sub statement at the bottom. Next,
select Tools·Macros, type AutoExec as your macro name, and
select Edit. Paste the macro text between the Sub and End
Sub statements in the macro editing window. Finally, double
click on the "go away" box in the upper left corner of the
editing window and tell Word for Windows that you want to
save the macro.
Try running the macro by clicking on the Start button.
Because this macro has the name AutoExec, it'll run every
time Word for Windows starts up. When it runs, you can
select a directory from the list or type in any other
directory name. If you type a directory name that doesn't
exist, the macro will offer to create it for you making it
easy to create new directories as you sort through your
documents. If you want a particular session to start without
this macro, use the program or File Manager's File·Run
command, and enter Winword /m at the command line.
---- BEGIN LISTING ----
Sub MAIN
Dim TypeArr$(4)
TypeArr$(0) = "Jones Account"
TypeArr$(1) = "Smith Account"
TypeArr$(2) = "Personal Letters"
TypeArr$(3) = "Temporary"
TypeArr$(4) = "Great American Novel"
TryAgain:
Begin Dialog UserDialog 325, 112
Text 6, 10, 300, 18, "Project Name or Path"
ComboBox 6, 25, 200, 85, TypeArr$(), .ProjDir
OKButton 250, 80, 40, 18
End Dialog
Dim Project As Dialog UserDialog
Dialog Project
Answer$ = Project.ProjDir
Select Case Project.ProjDir
Case "Jones Account"
ChDir "C:\jones"
Case "Smith Account"
ChDir "C:\smith"
Case "Personal Letters"
ChDir "C:\personal"
Case "Temporary"
ChDir "C:\temp"
Case ""
Goto TryAgain
Case Else
Err = 0
On Error Goto ErrorMsg
ChDir Answer$
Goto Done
ErrorMsg:
Prompt$ = "Create Directory: " + Answer$ + " ?"
Num = MsgBox(Prompt$, "Path Not Found", 36)
If Num = - 1 Then
MkDir Answer$
ChDir Answer$
Else
Goto TryAgain
End If
Done:
End Select
End Sub
---- END LISTING ----
Title: Defy WinWord Document Disorder
Category: WPR
Issue Date: June, 1992
Editor: Brett Glass
Supplementary Files: P5WPR\WWDIR.TXT
Filename: P5WPR004.TIP